const path = require('path')

function resolve(dir) {
    return path.join(__dirname, '../..', dir)
}

const target = 'http://127.0.0.1:6201'

module.exports = {
    title: '',
    // dest: 'dist/docs',
    // base: '/',
    description: 'Just playing around',
    theme: 'haigui-ui-theme',
    themeConfig: {

        logo: 'http://www.imlb2c.com/images/logo.png',
        //顶部导航栏配置
        nav: [
            { text: 'element官方文档', link: 'https://element.eleme.cn/#/zh-CN/component/installation', target: '_blank' }
        ],

        // 侧边栏设置
        sidebar: [{
            title: '如何使用',
            path: '/help/how-to-use'
        }, {
            title: '代码生成器',
            path: '/help/code-util'
        }, {
            title: '代码生成操作方法',
            path: '/help/code-util-operate'
        }, {
            title: '基础组件',
            collapsable: false, // 可选的, 默认值是 true,
            sidebarDepth: 3,
            children: [{
                title: 'ex-select-auto 下拉框 ',
                path: '/pub/ex-select-auto'
            },
            // {
            //     title: 'ex-case-number 案段号',
            //     path: '/pub/ex-case-number'
            // },
            {
                title: 'ex-table-auto 通用表格',
                path: '/pub/ex-table-auto'
            },
            {
                title: 'ex-table-mem 内存表格',
                path: '/pub/ex-table-mem'
            },
            {
                title: 'ex-sort-table 排序表格 ',
                path: '/pub/ex-sort-table'
            },
            {
                title: 'ex-dialog-form 弹窗表单',
                path: '/pub/ex-dialog-form'
            },
            {
                title: 'ex-button-delete 删除按钮',
                path: '/pub/ex-button-delete'
            },
            {
                title: 'ex-upload-img 图片上传',
                path: '/pub/ex-upload-img'
            },
            {
                title: 'ex-upload-file 文件上传',
                path: '/pub/ex-upload-file'
            },
            {
                title: 'ex-upload 文件上传',
                path: '/pub/ex-upload'
            },
            {
                title: 'ex-cascader 级联下拉选项 ',
                path: '/pub/ex-cascader'
            },
            {
                title: 'ex-export-form 动态文件导出',
                path: '/pub/ex-export-form'
            },
            {
                title: 'ex-html-editor 富文本编辑器',
                path: '/pub/ex-html-editor'
            },
            {
                title: 'ex-calendar 日期控件',
                path: '/pub/ex-calendar'
            },
            {
                title: 'ex-address 地址控件',
                path: '/pub/ex-address'
            },

            {
                title: 'ex-field-title 表单分组标题',
                path: '/pub/ex-field-title'
            },
            // {
            //     title: 'ex-modal 弹框',
            //     path: '/pub/ex-modal'
            // },
            // {
            //     title: 'ex-auto-tooltip 自动提示',
            //     path: '/pub/ex-auto-tooltip'
            // },
            // {
            //     title: 'ex-date-picker 日期选择器',
            //     path: '/pub/ex-date-picker'
            // },
            {
                title: 'ex-viewer 文件预览',
                path: '/pub/ex-viewer'
            },
            {
                title: 'js 扩展方法',
                path: '/pub/js-extend',
            }]
        }, {
            title: '页面组件',
            collapsable: false, // 可选的, 默认值是 true,
            sidebarDepth: 3,
            children: [{
                title: 'ex-select-auto 下拉框 ',
                path: '/pub/ex-select-auto'
            }, {
                title: 'ex-table-auto 通用表格',
                path: '/pub/ex-table-auto'
            }]
        }
            // , {
            //     title: '脚手架',
            //     path: '/pub/scaffold'
            // }
        ],
        // 将同时提取 markdown 中的 h2 显示在侧边栏上
        sidebarDepth: 0
    },
    // configureWebpack: (config, isServer) => {

    //     config.module.rules.push({
    //         test: /\.js$/,
    //         loader: 'babel-loader',
    //         include: [resolve('publish')]
    //     })

    //     config.module.rules.push({
    //         test: /\.vue$/,
    //         loader: 'vue-loader',
    //         include: [resolve('publish')]
    //     })

    // },

    devServer: {
        hot: true,
        proxy: {
            '/galileo-auto/*': {
                target,
                changeOrigin: true,
                pathRewrite: {}
            }
        }

    }


}